#include <iostream>
using namespace std;
template<typename Type>
void myswap(Type & a, Type & b)
{
	Type temp = a;
	a = b;
	b = temp;
}
template<typename Type>
void mysort(Type array[], int len)
{
	for (int i = 0; i < len; ++i)
	{
		int min = i;
		for (int j = i+1; j < len; ++j)
		{
			if(array[min] > array[j])
			{
				min = j;
			}
		}
		if(min != i)
		{
			myswap(array[min], array[i]);
		}
	}
}
void charArr()
{
	char a[] = "ddhsizopqlkaiurjxnmbcv";
	mysort<>(a, sizeof(a)/sizeof(char));
	for (int i = 0; i < sizeof(a)/sizeof(char); ++i)
	{
		cout<<a[i]<<" ";
	}
}
void intArr()
{
	int a[] = {1,23,5,2,76,45,23,54,78,37,9,56,90};
	mysort<>(a, sizeof(a)/sizeof(int));
	for (int i = 0; i < sizeof(a)/sizeof(int); ++i)
	{
		cout<<a[i]<<" ";
	}
}
int main()
{
	charArr();
	cout<<endl;
	intArr();
	return 0;
}